package action;
import dao.*;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class UserListAction extends ActionSupport{
	
	public String execute() throws Exception {
		//得到request对象
		ActionContext ac = ActionContext.getContext();        
		HttpServletRequest request=(HttpServletRequest)ac.get(ServletActionContext.HTTP_REQUEST);
        UsersDAO dao=new UsersDAO();
        List userlist=dao.findAll();
		request.setAttribute("userlist", userlist);
        return SUCCESS;
	}
}
